<?php
/**
 * Created by PhpStorm.
 * User: hoter.zhang
 * Date: 2017/8/14
 * Time: 10:27
 */

namespace app\models;


use yii\base\Object;

class FormInputAttr extends Object
{

    const INPUT_TEXT = 'text';
    const INPUT_HIDDEN = 'hidden';
    const INPUT_FILE = 'file';
    const INPUT_SELECT = 'select';
    const INPUT_CHECKBOX = 'checkbox';
    const INPUT_RADIO = 'radio';
    const INPUT_TEXTAREA = 'textarea';
    const INPUT_PASSWORD = 'password';
    const INPUT_SUBMIT = 'submit';

    const MUST_TRUE = 1;
    const MUST_FALSE = 0;

    static public function inputType(){
        return [
            self::INPUT_TEXT => '文本框',
            self::INPUT_HIDDEN => '隐藏框',
            self::INPUT_FILE => '文件上传',
            self::INPUT_SELECT => '下拉框',
            self::INPUT_CHECKBOX => '多选项',
            self::INPUT_RADIO => '单选项',
            self::INPUT_TEXTAREA => '文本域',
            self::INPUT_PASSWORD => '密码框',
            self::INPUT_SUBMIT=> '提交按钮',
        ];
    }

    static public function is_must(){
        return [
            self::MUST_TRUE => '是',
            self::MUST_FALSE => '否',
        ];
    }
}